#!/bin/bash
sudo rmmod rnpgbe
sudo modprobe rnpgbe
cp ../MacTool ./

chmod +x ./MacTool
chmod +x ./mucse_net_update_tool_gbe_1.0.0_x86

echo Please Input MAC Address:
read macaddr

./MacTool -c ${macaddr}
while true
do
  if [ -f "$(pwd)/error.txt" ];then
    echo MAC Address is not available! Please try again!
    echo Please Input MAC Address:
    read macaddr

    ./MacTool -c ${macaddr}
  else
    break
  fi
done
sudo ./mucse_net_update_tool_gbe_1.0.0_x86 -i 0 -led "0x4247c446 0x3b9aca0 0x9e4f58 0x17d7840"
sudo ./mucse_net_update_tool_gbe_1.0.0_x86 -i 0 -mac ${macaddr}
./MacTool -l ${macaddr}

./MacTool -a ${macaddr}
macaddr=$(cat ./addrfile.dat)
sudo ./mucse_net_update_tool_gbe_1.0.0_x86 -i 1 -led "0x4247c446 0x3b9aca0 0x9e4f58 0x17d7840"
sudo ./mucse_net_update_tool_gbe_1.0.0_x86 -i 1 -mac ${macaddr}
./MacTool -l ${macaddr}

echo M989-D01
